<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>BingoTouchWebApp</title>
<link rel="stylesheet" href="../common/jquery.mobile-1.1.0.min.css" />
<link rel="stylesheet" href="../common/BingoTouch.css" />
<script src="../common/iscroll.js"></script>
<script src="../common/debug.js"></script>
<script src="../common/jquery-1.7.1.min.js"></script>
<script src="../common/jquery.mobile-1.1.0.min.js"></script>
<script src="../common/BingoTouch.js"></script>
<script>
	BingoTouch.onMenu = function(){
		//BingoTouch.Common.alert("菜单按钮点击！");
	}
	BingoTouch.onload = function(){
		//alert($("meta[name='viewport']").attr("content"));
		//return;
		//var s = BingoTouch.WebView.width();
	};
	BingoTouch.init = function(){
		$("#testView").html("<li><a href=#>测试测试</a></li>");
		
		 //$(document).on('tap','#marketBtn',function(){
			 //alert("market");
		//	BingoTouch.WebView.load("../iBingo/market.html");
		//	return false;
		// });
		
	}
	BingoTouch.ready = function(){		
		$("#loginBtn").tap(function(e){
			BingoTouch.WebView.load("../iBingo/login.html");
			return false;
		});	
		$("#marketBtn").tap(function(e){
			BingoTouch.WebView.load("../iBingo/market.html");
			return false;
		});	
		$("#manageBtn").tap(function(e){
			BingoTouch.WebView.load("../iBingo/manager.html");
		});	
		$("#deskBtn").tap(function(e){
			BingoTouch.WebView.load("../iBingo/desk.html");
		});	
		$("#setupBtn").tap(function(e){
			BingoTouch.WebView.load("../iBingo/setup.html");
		});	
		
		$("#refreshBtn").tap(function(e){
			BingoTouch.WebView.refresh();
			//window.location.href = window.location.href;
			//BingoTouch.Common.alert("准备退出");
			//BingoTouch.WebView.refresh();
			//BingoTouch.App.exit();

		});	
		
		$("#clearHisBtn").tap(function(e){
			BingoTouch.WebView.clearHistory();
			BingoTouch.Common.alert("历史记录已经成功清除。");
		});	
		
		$("#map").tap(function(e){
			BingoTouch.WebView.wait(true);
			BingoTouch.Map.getLocation(getLoactionCallBack);
			
		});	
		
		$("#isConnected").tap(function(e){
			BingoTouch.Common.alert(BingoTouch.Common.isNetworkConnected());
		});	
		$("#getActiveNetwork").tap(function(e){
			BingoTouch.Common.alert(BingoTouch.Common.getActiveNetwork());
		});	
		$("#getNetworkStatus").tap(function(e){
			BingoTouch.Common.alert(BingoTouch.Common.getActiveNetworkStatus());
		});	 
		
		BingoTouch.Common.setNetworkChangeCallback(netCallBack);
		
		
		$("#startNotifactionService").tap(function(e){
			BingoTouch.Common.startNotifactionService("t1", "http://192.168.181.1/bingoweb/ibingo/notify.asp", 20000);
		});
		$("#stopNotifactionService").tap(function(e){
			BingoTouch.Common.stopNotifactionService("t1");
		});
		$("#getGlobalVariable").tap(function(e){
			alert(BingoTouch.App.getGlobalVariable("B"));
		});
		$("#setListView").tap(function(e){
			BingoTouch.WebView.load("APITest.html",'{"title":"中文","ary":[{"v","值"}]}');
		});
		$("#readSel").tap(function(e){
			alert($("#BTSelect").attr("value"));
		});
		
		$("#setSelectedIndex").tap(function(e){
			document.all('BTSelect').setSelectedIndex(4);
			
			document.all('BTCitySelect').setSelectedIndex('0,1');
			
		});
		$("#setDate").tap(function(e){
			document.all('BTDate').setDate('1999-9-9');
		});
		$("#showProgress").tap(function(e){
			BingoTouch.WebView.wait(true, null);
			setInterval("BingoTouch.WebView.wait(false)",5000);
		});
		
		$("#showAppInfo").tap(function(e){
			
			//alert(BingoTouch.App.getVersionCode());
			alert("应用标识:" + BingoTouch.App.getAppId() + "\n\r应用版本名:" + BingoTouch.App.getVersionName() + "\n\r应用版本号:" + BingoTouch.App.getVersionCode());
		});
		
		$("#cityChannel").tap(function(e){	
			//BingoTouch.WebView.load("http://10.20.48.209:8048/Mobile/Views/Login.html");
			//BingoTouch.WebView.load("../DataWatch/gongdan.html");
		});
		$("#cityChannelDebug").tap(function(e){	
			BingoTouch.WebView.load("http://10.20.48.59/GMCC/Views/login.html");
			//BingoTouch.WebView.load("../DataWatch/gongdan.html");
		});
		$("#clearAppBtn").tap(function(e){
			//var address = "http://bistore.gmcc.net";
			//var appId = "BIC_2012062911322788";
			//var appSecret = "053abbb209d7c7ba029261a6c99a87ef";
			//BingoTouch.BIS.setClient(address, appId, appSecret);
		
			//var checkResult = BingoTouch.BIS.login("cmcc_test3", "cmcc_test3123456");
			//alert(checkResult);

	
			BingoTouch.Local.clearHashmap("LocalAppList");
			BingoTouch.Common.alert("清除成功");
		});
		
		
		$("#tempTest").tap(function(e){
			BingoTouch.WebView.load("../bingosoftapp/index.html");
			//var json=[{"lo":20,"la":30,"icon":1,"data":"json"},{"lo":20,"la":30,"icon":1,"data":"json"}];
			//alert(BingoTouch.Common.json2string(json));
			//window.BingoWebView.getBaiduMap(json,'baidumap');


			//BingoTouch.WebView.showPic('http://www.baidu.com/img/baidu_sylogo1.gif');
			//var a = '[{"entitywarehouseid":"2924","entitywarehousename":"cangku"},{"entitywarehouseid":"2443","entitywarehousename":"测试"},{"entitywarehouseid":"1375","entitywarehousename":"佛山4号"},{"entitywarehouseid":"1501","entitywarehousename":"佛山7号"}]';
			//var s = BingoTouch.Common.string2json(a);
			//alert(s.length);
			
			//BingoTouch.Message.send("","");
			
			//queryParam = '{"pager":{"pageSize":20,"page":1},"orderBy":" order by createTime desc","typeCode": "Android"}';
			//BingoTouch.Common.WebRequest("http://192.168.100.100/bingoweb/Test.asp","GET",null,null,true,netCallBack,null,null,null,[{"key":"ABC","value":"1"},{"key":"XYZ","value":2}]);	
			//alert("OK");
			//BingoTouch.WebView.load("BingoDebug.html");
			//BingoTouch.Common.alert("网络：" + BingoTouch.Common.getActiveNetwork());
		
			//BingoTouch.Common.alert("高度：" +BingoTouch.Device.height());
			
			//BingoTouch.Common.alert(s);
			//BingoTouch.App.setLocalVariable("LocalAppList","[]");
			//var appList = BingoTouch.App.getLocalVariable("LocalAppList");
			//appList = BingoTouch.Common.string2json(appList);
			//alert(appList[0].name);
						
			//BingoTouch.WebView.load("../DataWatch/baobiao.html");
			//$("#BTSelect").attr("selectedIndex","4");
			//alert($("#BTSelect")[0]);
			//document.all('BTSelect').setSelectedIndex = BingoTouch.WebView.setSelectedIndex;
			//document.all('BTSelect').setSelectedIndex(5);
			
			//document.all('BTSex').setSelectedIndex(1);
			
		});
		
		$("#videoPlay").tap(function(e){
			if (document.all("videoUri").value != ""){
				BingoTouch.Video.play(document.all("videoUri").value);
			}else
			{alert('请输入远程或本地视频地址');}
			
		});
		
		$("#getBarCode").tap(function(e){
			BingoTouch.Device.getBarcode(getCode);
			
		});
		$("#debugBtn").tap(function(e){
			BingoTouch.WebView.load("BingoDebug.html");
			
		});
		$("#telCall").tap(function(e){
			BingoTouch.Device.call("13760783985",netCallBack);
			
		});
		$("#getPhoto").tap(function(e){
			BingoTouch.Device.getPhoto(netCallBack);
			
		});
		$("#localFileSelector").tap(function(e){
			BingoTouch.Local.localFileSelector(netCallBack);
			
		});
		$("#Grape_Reg").tap(function(e){
			BingoTouch.Grape.register("13711450454");
			
		});
		$("#Grape_Show").tap(function(e){
			BingoTouch.Grape.showUIComponent("ahf","test1_1");
			
		});
		$("#Grape_Reg").tap(function(e){
			BingoTouch.Grape.hideUIComponet();
			
		});
		
	}
	function getLoactionCallBack(lo,la){
		BingoTouch.WebView.wait(false);
		var j = [{"lo":lo,"la":la,"icon":1,"data":111,title:"品高软件开发有限公司",content:"电话：020-8888888|地址：广州市天河区天河高新技术产业园高普路1135号三楼"},{"lo":parseInt(lo),"la":la,"icon":2,"data":222,title:"",content:""}];
		BingoTouch.Map.initMap(j,lo,la,netCallBack);
	}
	function getCode(c){
		BingoTouch.Common.alert(c);
	}
	
	function netCallBack(r){
		alert("回调成功。");
		alert(r);
	}
	function progressCallBack(){alert('取消！');}
	
</script>
<style type="text/css">
	input[type="text"],
	div[data-role="BTButton"],
	div[data-role="BTSelect"]{
		margin-bottom:15px;
	}
</style>
</head>
<body>
<div data-role="page">
	<div data-role="header"></div>  
	<div data-role="content">
		<div class="header">
			<!-- align="left" align="right" 可以方便控制文本对齐方式，不写默认居中 -->
			<h1 class="title">APITest</h1>
			<div class="header-left">
				<div class="btn-back" data-role="BTButton" data-url="home.html">返回</div>
			</div>
			<div class="header-right"></div>
		</div>
		<div class="content">
			<div class="content-inner">
				<div data-role="BTButton" id="refreshBtn">刷新</div><br> 
				<div id="getBarCode" data-role="BTButton">条码扫描</div><br>
				<div id="telCall" data-role="BTButton">拨打电话</div><br>
				<div id="getPhoto" data-role="BTButton">拍照</div><br>
				<div id="localFileSelector" data-role="BTButton">选择本地文件</div><br>

   				<div id="Grape_Reg" data-role="BTButton">葡萄园：注册用户</div><br>
                <div id="Grape_Show" data-role="BTButton">葡萄园：显示</div><br>
                <div id="Grape_Hide" data-role="BTButton">葡萄园：隐藏</div><br>
				
				BTInput：<input type="text" id="user" data-role="BTInput" value=""><br>
				多行文本：<textarea style="width:100%;"></textarea><br>
				默认样式的复选控件：<div id="BTCheck" data-role="BTCheck"></div><br>
				自定义样式的复选控件：<div id="BTSwitch" data-role="BTCheck"></div><br>
				
				<div id="setSelectedIndex" data-role="BTButton">设置指定的国家与城市</div><br>
							
				<div id="BTSelect" onChange="alert(document.all('BTSelect').innerText + '：' + document.all('BTSelect').value);" data-role="BTSelect" value="" selectedIndex="-1" data='{"title":"请选择国家","data":[{"text":"中华人民共和国","value":0},{"text":"美国","value":1},{"text":"日本","value":2},{"text":"法国","value":3},{"text":"英国","value":4},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1},{"text":"美国","value":1}]}'><span>请选择国家</span></div> <br>
				
				<div id="BTCitySelect" onChange="alert(document.all('BTCitySelect').innerText + '：' + document.all('BTCitySelect').value);" data-role="BTSelect" value="" selectedIndex="1,0" data='{"title":"请选择国家", "data":[{"text":"中国","value":0,"data":[{"text":"广东","value":0},{"text":"湖南","value":1}]},{"text":"美国","value":1,"data":[{"text":"纽约","value":0},{"text":"华盛顿","value":40}]}]}'><span>请选择城市</span></div> <br>
				
				<div id="BTSex" data-role="BTSelect" value="" selectedIndex="-1" data='{"title":"请选择性别","data":[{"text":"男性","value":0},{"text":"女性","value":1}]}'><span>请选择性别</span></div> <br>
				
				<div id="setDate" data-role="BTButton">设置指定的日期</div><br>
				<div id="BTDate" onChange="alert(document.all('BTDate').value);" data-role="BTDate" value="" data='{"title":"请选择日期"}'><span>请选择日期</span></div><br>
				
				<hr>
				<div id="tempTest" data-role="BTButton">临时测试</div><br>
				<div id="map" data-role="BTButton">地图应用</div><br>

				<div id="clearAppBtn" data-role="BTButton">清空iBingo本地应用</div><br>            
				<div id="debugBtn" data-role="BTButton">DebugTool</div><br>
				<div id="loginBtn" data-role="BTButton">MoblieOne登录页</div><br>
				<div data-role="BTButton" id="deskBtn">MoblieOne桌面页</div><br>
				<div data-role="BTButton" id="marketBtn">MoblieOne市场页</div><br>
				<div data-role="BTButton" id="manageBtn">MoblieOne管理页</div><br>
				<div data-role="BTButton" id="setupBtn">MoblieOne配置页</div><br>
				<div data-role="BTButton" id="clearHisBtn">清除历史记录</div><br>
				<div data-role="BTButton" id="isConnected">网络是否连接</div><br>
				<div data-role="BTButton" id="getActiveNetwork">当前网络类型</div><br>
				<div data-role="BTButton" id="getNetworkStatus">当前网络状态</div><br>
				<div data-role="BTButton" id="startNotifactionService">开始定时服务</div><br>
				<div data-role="BTButton" id="stopNotifactionService">停止定时服务</div><br>
				<div data-role="BTButton" id="getGlobalVariable">读取全局变量</div><br>
				<div id="setListView" data-role="BTButton">Load测试</div><br>
				
				<div id="showProgress" data-role="BTButton">显示进度条</div><br>
				<div id="showAppInfo" data-role="BTButton">显示应用信息</div><br>
				<div id="cityChannel" data-role="BTButton">渠道监控内部测试版</div><br>
				<div id="cityChannelDebug" data-role="BTButton">渠道监控本地开发版</div><br>
				
				视频：<input type="text" id="videoUri" data-role="BTInput" value="http://directguo.com/html5/src/chrome_japan.mp4"><br>
				<div id="videoPlay" data-role="BTButton">播放</div><br>
				
				<br><br><br>
				
				<textarea id="TTTT"/>

			</div>
		</div>
		    
	</div>
</div>

</body>
</html>